#!/usr/bin/env bash

echo "OpenCV_VERSION=@OpenCV_VERSION@"
echo "OpenCV_VERSION_MAJOR=@OpenCV_VERSION_MAJOR@"
echo "OpenCV_VERSION_MINOR=@OpenCV_VERSION_MINOR@"
echo "OpenCV_VERSION_PATCH=@OpenCV_VERSION_PATCH@"
echo "OpenCV_VERSION_STATUS=@OpenCV_VERSION_STATUS@"


contains() {
    [ `echo $1 | grep -c "$2"` -gt 0 ]
}

if contains "@OpenCV_INCLUDE_DIRS@" "/ros/"; then
    ROS_VERSION=$(rosversion -d)
    echo "OpenCV_VERSION=ros-$ROS_VERSION"
fi

exit 0